background: rgba(0,0,0,0.9);
border: 1px solid rgba(128,128,128,0.45);
color: white;
+}
+
+#calendarPopup .calendar {
padding: 10px;
}
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
+const Clutter = imports.gi.Clutter;
const Lang = imports.lang;
const St = imports.gi.St;
this.date = new Date();
this.actor = new St.Table({ homogeneous: false,
- style_class: "calendar" });
+ style_class: "calendar",
+ reactive: true });
+
+ this.actor.connect('scroll-event',
+ Lang.bind(this, this._onScroll));
// Top line of the calendar '<| September 2009 |>'
this._topBox = new St.BoxLayout();
}
},
+ _onScroll : function(actor, event) {
+ switch (event.get_scroll_direction()) {
+ case Clutter.ScrollDirection.UP:
+ case Clutter.ScrollDirection.LEFT:
+ this._prevMonth();
+ break;
+ case Clutter.ScrollDirection.DOWN:
+ case Clutter.ScrollDirection.RIGHT:
+ this._nextMonth();
+ break;
+ }
+ },
+
_prevMonth: function() {
if (this.date.getMonth() == 0) {
this.date.setMonth(11);